package com.example.xinli.fragment;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.fragment.app.Fragment;

import com.example.xinli.AITaskActivity;
import com.example.xinli.BadgeWallActivity;
import com.example.xinli.DocTaskActivity;
import com.example.xinli.R;
import com.example.xinli.RewardActivity;
import com.example.xinli.BadgeWallActivity;

public class InterventionFragment extends Fragment {
    private TextView AITaskTV;
    private TextView DocTaskTV;
    private TextView ToolLibraryTV;
    private TextView RewardTV;

    @SuppressLint("MissingInflatedId")
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_intervention, container, false);

        AITaskTV = view.findViewById(R.id.AITaskTV);
        AITaskTV.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                toAITask(v);
            }
        });

        DocTaskTV = view.findViewById(R.id.DocTaskTV);
        DocTaskTV.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                toDocTask(v);
            }
        });

        ToolLibraryTV = view.findViewById(R.id.ToolLibraryTV);
        ToolLibraryTV.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                toTool(v);
            }
        });

        RewardTV = view.findViewById(R.id.RewardTV);
        RewardTV.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                toReward(v);
            }
        });

        return view;
    }

    public void toAITask(View view){
        Intent intent = new Intent(getActivity(), AITaskActivity.class);
        startActivity(intent);
    }

    public void toDocTask(View view){
        Intent intent = new Intent(getActivity(), DocTaskActivity.class);
        startActivity(intent);
    }

    public void toTool(View view){
        Intent intent = new Intent(getActivity(), BadgeWallActivity.class);
        startActivity(intent);
    }

    public void toReward(View view){
        Intent intent = new Intent(getActivity(), RewardActivity.class);
        startActivity(intent);
    }
}
